<script setup>
import { useRouter } from 'vue-router'
const router = useRouter();
const props = defineProps({
    info:{
        type:Object
    }
})
const goToDetail = (cinemaId)=>{
    // console.log(cinemaId);
    router.push(`/cinema/${cinemaId}`)
}
// console.log(route);
</script>

<template>
    <div class="card" @click="goToDetail(props.info.cinemaId)">
        <div class="title">
            <div class="nm">
                <van-text-ellipsis class="movie-name" :content="props.info.title" />
                <span class="price">
                    <span class="big">{{ props.info.price.n }}</span> 
                    {{ props.info.price.q }}
                </span>
            </div>
        </div>
        <p class="location">
            <van-text-ellipsis class="movie-name" :content="props.info.location" />
        </p>
        <p class="services">
            <span v-for="(el,index) in props.info.services" :key="index" :class="el.code">{{ el.text }}</span>
        </p>
    </div>
</template>

<style lang="scss" scoped>
.card{
    padding: 10px 0;
    border-bottom: 1px solid #e8e8e8;
    .title{
        color: #000;
        font-size: 16px;
        .nm{
            display: flex;
            .movie-name{
                flex: 1;
            }
        }
        .price{
            color: #f03d37;
            font-size: 12px;
            .big{
                font-size: 18px;
            }
        }
    }
    .location{
        color: #666;
        margin-top: 8px;
        font-size: 13px;
        line-height: 14px;
    }
    .services{
        margin-top: 5px;
        line-height: 18px;
        span{
            font-size: 12px;
            padding: 0 4px;
            margin-right: 5px;
            margin-bottom: 5px;
            &.endorse,&.hallType,&.allowRefund{
                color: #589daf;
                border: 1px solid #589daf ;
            }
            &.snack,&.vipTag{
                color: #f90;
                border: 1px solid #f90 ;
            }
        }
    }
}
</style>